// Package sys
// @Link  https://github.com/bufanyun/hotgo
// @Copyright  Copyright (c) 2025 HotGo CLI
// @Author  Ms <133814250@qq.com>
// @License  https://github.com/bufanyun/hotgo/blob/master/LICENSE
// @AutoGenerate Version 2.15.11
package sys

import (
	"context"
	"hotgo/api/admin/walletwithdrawallog"
	"hotgo/internal/model/input/sysin"
	"hotgo/internal/service"
)

var (
	WalletWithdrawalLog = cWalletWithdrawalLog{}
)

type cWalletWithdrawalLog struct{}

// List 查看钱包-提现记录列表
func (c *cWalletWithdrawalLog) List(ctx context.Context, req *walletwithdrawallog.ListReq) (res *walletwithdrawallog.ListRes, err error) {
	list, totalCount, err := service.SysWalletWithdrawalLog().List(ctx, &req.WalletWithdrawalLogListInp)
	if err != nil {
		return
	}

	if list == nil {
		list = []*sysin.WalletWithdrawalLogListModel{}
	}

	res = new(walletwithdrawallog.ListRes)
	res.List = list
	res.PageRes.Pack(req, totalCount)
	return
}

// Export 导出钱包-提现记录列表
func (c *cWalletWithdrawalLog) Export(ctx context.Context, req *walletwithdrawallog.ExportReq) (res *walletwithdrawallog.ExportRes, err error) {
	err = service.SysWalletWithdrawalLog().Export(ctx, &req.WalletWithdrawalLogListInp)
	return
}

// View 获取指定钱包-提现记录信息
func (c *cWalletWithdrawalLog) View(ctx context.Context, req *walletwithdrawallog.ViewReq) (res *walletwithdrawallog.ViewRes, err error) {
	data, err := service.SysWalletWithdrawalLog().View(ctx, &req.WalletWithdrawalLogViewInp)
	if err != nil {
		return
	}

	res = new(walletwithdrawallog.ViewRes)
	res.WalletWithdrawalLogViewModel = data
	return
}

// Delete 删除钱包-提现记录
func (c *cWalletWithdrawalLog) Delete(ctx context.Context, req *walletwithdrawallog.DeleteReq) (res *walletwithdrawallog.DeleteRes, err error) {
	err = service.SysWalletWithdrawalLog().Delete(ctx, &req.WalletWithdrawalLogDeleteInp)
	return
}